import { Image, View } from '@tarojs/components';
import React from 'react';
import { defaultVisibleEnums } from '../../moduleConstants';
import ImgCover from '../../product/ImgCover';
import styles from './index.module.scss';
const ProductImg = ({ style, content, url, isSoldOut, fontSize, className = '' }) => {
  return (
    <View className={`${styles.ProductImg} ${className}`}>
      <Image src={url} mode='aspectFill' style={{position:'absolute',left:0,right:0,top:0,bottom:0,zIndex:1}} className='img'></Image>
      {content?.saleOut === defaultVisibleEnums.show && isSoldOut && (
        <ImgCover fontSize={fontSize} txt="售罄" />
      )}
    </View>
  );
};

export default ProductImg;
